<?php

class Users_Form_Profile extends Zend_Form {

	public function init() {
		$this->setMethod('post');
		
		$username = $this->createElement('text', 'username');
		$username->setLabel(_('Логин:'));
		$username->setAttrib('size','32');
		$username->setAttrib('maxlength','255');
		$username->setRequired(true);
		
		
		$email = $this->createElement('text','email');
		$email->setLabel(_('Email:'));
		$email->setAttrib('size','32');
		$email->setAttrib('maxlength','255');
		$email->addValidator('EmailAddress', true);
		$email->setRequired(true);
		
		$first_name = $this->createElement('text', 'first_name');
		$first_name->setLabel(_('Ваше настоящее имя:'));
		$first_name->setAttrib('size','32');
		$first_name->setAttrib('maxlength','255');
		$first_name->setRequired(true);
		
		$last_name = $this->createElement('text', 'last_name');
		$last_name->setLabel(_('Ваша фамилия:'));
		$last_name->setAttrib('size','32');
		$last_name->setAttrib('maxlength','255');
		$last_name->setRequired(true);
		
		$sex = $this->createElement('radio', 'sex');
		$sex->setLabel(_('Пол:'));
		$sex->setRequired(true);
		$sex->addMultiOptions(array('1' => _('Муж.'), '0' => _('Жен.')));
		$sex->setSeparator(' ');
		$sex->setValue('1');
		
		$birthday = new Nimblecms_Form_Element_Date('birthday');
		$birthday->setLabel(_('Дата рождения:'));
		$birthday->setRequired(true);
		
		$about = $this->createElement('textarea', 'about');
		$about->setLabel(_('Обо мне:'));
		$about->setDescription(_('Краткая информация о вас'));
		$about->setAttrib('cols', '48');
		$about->setAttrib('rows', '12');
		
		$show_email = $this->createElement('radio', 'show_email');
		$show_email->setLabel(_('Показывать email:'));
		$show_email->addMultiOptions(array('1' => _('Да'), '0' => _('Нет')));
		$show_email->setSeparator(' ');
		$show_email->setValue('0');

		$show_birthday = $this->createElement('radio', 'show_birthday');
		$show_birthday->setLabel(_('Показывать день рождения:'));
		$show_birthday->addMultiOptions(array('1' => _('Да'), '0' => _('Нет')));
		$show_birthday->setSeparator(' ');
		$show_birthday->setValue('1');

		$show_me = $this->createElement('select', 'show_me');
		$show_me->setLabel(_('Показывать мой профиль:'));
		$show_me->addMultiOptions(array('all' => _('Всем'), 'freind' => _('Друзьям'), 'no' => _('Никому')));
		$show_me->setValue('all');
		
		$submit = $this->createElement('submit', 'submit');
		$submit->setLabel(_('Сохранить'));
		
		$this->addElements(array($username,$email,$first_name,$last_name,$show_email,$birthday,$show_birthday,$sex,$about,$show_me,$submit));
	}
}